﻿using Microsoft.Graphics.Canvas;
using Microsoft.Graphics.Canvas.Effects;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Documents;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using 纸片人.CalculateControls;
using 纸片人.ConvertClass;
using 纸片人.win2dEffectControl.DataClass;


// The Templated Control item template is documented at https://go.microsoft.com/fwlink/?LinkId=234235

namespace 纸片人.win2dEffectControl
{
    public  class MorphologyEffectControl : EffectControl
    {
        private Vector2Control sizeVector2Control;
        private ComboBox modeComboBox;
        public override EffectOneSourceData OneEffetData { get; set; }

        /// <summary>
        /// 边缘效果模式列表
        /// </summary>
        List<MorphologyEffectMode> listMorphologyEffectMode = new List<MorphologyEffectMode>();

        public MorphologyEffectControl()
        {
            this.DefaultStyleKey = typeof(MorphologyEffectControl);
            OneEffetData =new  MorphologyEffectData();
            listMorphologyEffectMode = EffectUtil.GetEnumList<MorphologyEffectMode>();

        }

        protected override void OnApplyTemplate()
        {
            base.OnApplyTemplate();


         
            modeComboBox = GetTemplateChildFormName<ComboBox>(nameof(modeComboBox));
            SetComboBox(modeComboBox, listMorphologyEffectMode, OneEffetData, nameof(MorphologyEffectData.Mode));


            sizeVector2Control = GetTemplateChildFormName<Vector2Control>(nameof(sizeVector2Control));
            SetVector2Control(sizeVector2Control, OneEffetData, nameof(MorphologyEffectData.EffectSize));
        }

     

     






      


      
    }
}
